package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.StudentWorkMapper;
import com.education.wisdom.pojo.StudentWork;
import com.education.wisdom.service.IStudentWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 学生提交作业 服务层实现
 *
 * @author ruoyi
 * @date 2019-06-20
 */
@Service
public class StudentWorkServiceImpl implements IStudentWorkService {
    @Autowired
    private StudentWorkMapper studentWorkMapper;

    /**
     * 查询学生提交作业信息
     *
     * @param id 学生提交作业ID
     * @return 学生提交作业信息
     */
    @Override
    public StudentWork selectStudentWorkById(Integer id) {
        return studentWorkMapper.selectStudentWorkById(id);
    }

    /**
     * 查询学生提交作业列表
     *
     * @param studentWork 学生提交作业信息
     * @return 学生提交作业集合
     */
    @Override
    public List<StudentWork> selectStudentWorkList(StudentWork studentWork) {
        return studentWorkMapper.selectStudentWorkList(studentWork);
    }

    /**
     * 新增学生提交作业
     *
     * @param studentWork 学生提交作业信息
     * @return 结果
     */
    @Override
    public int insertStudentWork(StudentWork studentWork) {
        return studentWorkMapper.insertStudentWork(studentWork);
    }

    /**
     * 修改学生提交作业
     *
     * @param studentWork 学生提交作业信息
     * @return 结果
     */
    @Override
    public int updateStudentWork(StudentWork studentWork) {
        return studentWorkMapper.updateStudentWork(studentWork);
    }

    /**
     * 删除学生提交作业对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStudentWorkByIds(String ids) {
        return studentWorkMapper.deleteStudentWorkByIds(Convert.toStrArray(ids));
    }

    @Override
    public void updateTeacherommentById(Map<String, Object> map) {
        studentWorkMapper.updateTeacherommentById(map);
    }

    @Override
    public void updateByMap(Map<String, Object> map) {
        studentWorkMapper.updateByMap(map);
    }

    @Override
    public List<StudentWork> selectByMap(Map<String, Object> map) {
        return studentWorkMapper.selectByMap(map);
    }

    @Override
    public StudentWork selectDetailsByMap(Map<Object, Object> map) {
        return studentWorkMapper.selectDetailsByMap(map);
    }

}
